/*
** openurl.library - universal URL display and browser launcher library
** Written by Troels Walsted Hansen <troels@thule.no>
** Placed in the public domain.
**
** Library definitions and structures.
*/
/**************************************************************************/

MODULE  'dos'
MODULE  'exec/lists'
MODULE  'exec/nodes'
MODULE  'utility/tagitem'

/**************************************************************************/

#define URL_Tagbase  TAG_USER

/* these tags are all you need to use openurl.library, the rest of the stuff 
   in this include file is only of interest to prefs program writers.
*/

#define URL_Show           (URL_Tagbase + 1)    /* BOOL - show/uniconify browser */
#define URL_BringToFront   (URL_Tagbase + 2)    /* BOOL - bring browser to front */
#define URL_NewWindow      (URL_Tagbase + 3)    /* BOOL - open URL in new window */
#define URL_Launch         (URL_Tagbase + 4)    /* BOOL - launch browser when not running */
#define URL_PubScreenName  (URL_Tagbase + 5)    /* STRPTR - name of public screen to launch at */

/* this is Version 3 of this structure */

#define UPF_ISDEFAULTS   (1<<0) /* V2 - structure contains the default settings */
#define UPF_PREPENDHTTP  (1<<1) /* V3 - prepend "http://" to URLs w/o scheme */
#define UPF_DOMAILTO     (1<<2) /* V3 - mailto URLs get special treatment */

OBJECT URL_Prefs
        Version:UBYTE,           /* always check this version number! */
        BrowserList:MinList,     /* list of struct URL_BrowserNodes */
        MailerList:MinList,      /* V3 - list of struct URL_MailerNodes */
        Flags:ULONG,          /* V2 - flags, see above            */
        DefShow:BOOL,            /* these BOOLs are the defaults for */
        DefBringToFront:BOOL,    /* the similarly named tags         */
        DefNewWindow:BOOL,       /* they are all new with Version 2  */
        DefLaunch:BOOL

#define REXX_CMD_LEN  64
#define UBNF_URLONCMDLINE  (1<<0)       /* if set, browser supports getting an URL on 
                                    the commandline when launched. obsolete as
                                    of V3 - use %u on commandline instead */
#define UBN_NAME_LEN          32
#define UBN_PATH_LEN          256   //FMSIZE
#define UBN_PORT_LEN          32
#define UBN_SHOWCMD_LEN       REXX_CMD_LEN
#define UBN_TOFRONTCMD_LEN    REXX_CMD_LEN
#define UBN_OPENURLCMD_LEN    REXX_CMD_LEN
#define UBN_OPENURLWCMD_LEN   REXX_CMD_LEN

OBJECT URL_BrowserNode
        Node:MinNode,
        Flags:ULONG,                           /* flags, see above */
        Name[UBN_NAME_LEN]:UBYTE,                  /* name of webbrowser */
        Path[UBN_PATH_LEN]:UBYTE,                  /* complete path to browser */
        Port[UBN_PORT_LEN]:UBYTE,                  /* webbrowser arexx port */
        ShowCmd[UBN_SHOWCMD_LEN]:UBYTE,            /* command to show/uniconify browser */
        ToFrontCmd[UBN_TOFRONTCMD_LEN]:UBYTE,      /* command to bring browser to front */
        OpenURLCmd[UBN_OPENURLCMD_LEN]:UBYTE,      /* command to open url */
        OpenURLWCmd[UBN_OPENURLWCMD_LEN]:UBYTE     /* command to open url in new window */

#define UMN_NAME_LEN          32
#define UMN_PATH_LEN          256    //FMSIZE
#define UMN_PORT_LEN          32
#define UMN_SHOWCMD_LEN       REXX_CMD_LEN
#define UMN_TOFRONTCMD_LEN    REXX_CMD_LEN
#define UMN_WRITEMAILCMD_LEN  (REXX_CMD_LEN * 2)

OBJECT URL_MailerNode
        Node:MinNode,
        Flags:ULONG,                             /* flags, see above */
        Name[UMN_NAME_LEN]:UBYTE,                    /* name of mailer */
        Path[UMN_PATH_LEN]:UBYTE,                    /* complete path to mailer */
        Port[UMN_PORT_LEN]:UBYTE,                    /* mailer arexx port */
        ShowCmd[UMN_SHOWCMD_LEN]:UBYTE,              /* command to show/uniconify mailer */
        ToFrontCmd[UMN_TOFRONTCMD_LEN]:UBYTE,        /* command to bring mailer to front */
        WriteMailCmd[UMN_WRITEMAILCMD_LEN]:UBYTE     /* command to write mail */

/* LIBRARIES_OPENURL_H */

